import { BrowserRouter, Link, Navigate, Route, Routes } from "react-router-dom"
import Home from "./pages/Home/Home"
import About from "./pages/About/About"

const App=()=>{
  return (
    // 指定路由模式
    <BrowserRouter>
      {/* 定义路由入口 */}
      <Link to={"/home"}>跳转到Home</Link>
      <Link to={"/about/2"}>跳转到About</Link>

      <Routes>
        <Route path="/" element={<Navigate to={"/home"}></Navigate>}></Route>
        <Route path="/home" element={<Home></Home>}></Route>
        <Route path="/about/:id" element={<About></About>}></Route>
      </Routes>
    </BrowserRouter>
  )
}

export default App